import java.awt.*;

import javax.swing.*;
import java.awt.event.*;
import java.awt.print.*;
import java.awt.geom.*;

public class PrintExample extends JFrame implements ActionListener {
  public static void main(String[] args) {
    new PrintExample();
  }

  public PrintExample() {
    super("Printing Swing Components");
    WindowShow.setNativeLookAndFeel();
    addWindowListener(new ExitListener());
    Container content = getContentPane();
    JButton printButton = new JButton("Print");
    printButton.addActionListener(this);
    JPanel buttonPanel = new JPanel();
    buttonPanel.setBackground(Color.white);
    buttonPanel.add(printButton);
    content.add(buttonPanel, BorderLayout.SOUTH);
    DrawDial applet = new DrawDial(9,24,39,54,69,84,-96,-81,-66,-51,-36,-21,-6);
    //DrawGnomon applet = new DrawGnomon(45);
    content.add(applet, BorderLayout.CENTER);
    setSize(Toolkit.getDefaultToolkit().getScreenSize( ));
    setVisible(true);
  }
  
  public void actionPerformed(ActionEvent event) {
	DrawDial applet = new DrawDial(9,24,39,54,69,84,-96,-81,-66,-51,-36,-21,-6);
	//DrawGnomon applet = new DrawGnomon(45);
    PrintableDocument.printComponent(applet);
  }
  
}